package com.tecbog.main.controller;

import com.tecbog.common.api.IDemoService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @DubboReference(interfaceClass = IDemoService.class,check = false)
    private IDemoService demoService;

    @GetMapping("/call")
    public String test(@RequestParam(name = "name",defaultValue = "zhangsan And Lisi")String name ){
        String zhangsan = demoService.greet(name);
        return zhangsan;
    }
}
